package com.group01.community.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.group01.community.entity.SysDictData;
import com.group01.community.entity.SysDictType;
import com.group01.community.mapper.SysDictDataMapper;
import com.group01.community.service.SysDictDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典数据表 服务实现类
 * </p>
 *
 * @author iuoly
 * @since 2022-07-04
 */
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
    @Autowired
    private SysDictDataMapper sysDictDataMapper;

    @Override
    public List<SysDictData> selectDictDataByDictId(Long dictId) {
        return sysDictDataMapper.selectDictDataByDictId(dictId);
    }

    @Override
    public List<SysDictType> selectDictType() {
        return sysDictDataMapper.selectDictType();
    }

    @Override
    public IPage<SysDictData> selectCondition(SysDictData sysDictData, Long current, Long size) {
        return sysDictDataMapper.selectCondition(sysDictData, new Page<>(current, size));
    }

    @Override
    public List<SysDictData> selectPage(Long current, Long size) {
        return sysDictDataMapper.selectPage(new Page<>(current, size));
    }
}
